# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Alessio 'mOLOk' Bolognino <themolok@gmail.com>

pkgname=moreutils
pkgver=0.67
pkgrel=4
pkgdesc="A growing collection of the unix tools that nobody thought to write thirty years ago"
arch=('loong64' 'x86_64')
url="https://joeyh.name/code/moreutils/"
license=('GPL')
depends=('perl' 'perl-ipc-run' 'perl-timedate' 'perl-time-duration')
makedepends=('docbook2x' 'docbook-xml' 'perl-xml-sax' 'git')
options=('!emptydirs' 'zipman')
replaces=(moreutils-svn)
source=("git+https://git.joeyh.name/git/moreutils.git?signed#tag=$pkgver")
sha256sums=('SKIP')
validpgpkeys=('E85A5F63B31D24C1EBF0D81CC910D9222512E3C7')

build() {
  cd $pkgname
  make DOCBOOK2XMAN=db2x_docbook2man
}

package() {
  cd $pkgname
  make PREFIX="$pkgdir"/usr install
  chmod 0644 "$pkgdir"/usr/share/man/man1/*
  mv "$pkgdir"/usr/share/man/man1/ts.1 "$pkgdir"/usr/share/man/man1/ts.1moreutils
  mv "$pkgdir"/usr/share/man/man1/parallel.1 "$pkgdir"/usr/share/man/man1/parallel-moreutils.1
  mv "$pkgdir"/usr/bin/parallel "$pkgdir"/usr/bin/parallel-moreutils
}
